package Solutions;

/**
 * @Classname LengthOfLastWord
 * @Description TODO
 * @Date 2021/9/21 11:22
 * @Created by ASUS
 */
public class LengthOfLastWord {
    public int lengthOfLastWord(String s) {
        String[] s1 = s.trim().split(" ");
        return s1[s1.length - 1].length();
    }

    public static void main(String[] args) {
        System.out.println(new LengthOfLastWord().lengthOfLastWord("hello world   "));
    }
}
